import Vue from 'vue'
import App from './App.vue'
// import Element from 'element-ui'
import { cloneDeep } from 'lodash'
import router from './router'
import store from './store'
import './plugins'
import './components'
import './icons'
import NProgress from 'nprogress'

import * as echarts from 'echarts'
// import * as echarts from 'echarts/core'
// import { TitleComponent, ToolboxComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components'
// import { LineChart } from 'echarts/charts'
// import { UniversalTransition } from 'echarts/features'
// import { CanvasRenderer } from 'echarts/renderers'
// echarts.use([
//   TitleComponent,
//   ToolboxComponent,
//   TooltipComponent,
//   GridComponent,
//   LegendComponent,
//   LineChart,
//   CanvasRenderer,
//   UniversalTransition
// ])
import Vditor from 'vditor'
import axios from './plugins/axios'
import './assets/scss/index.scss'
// import 'nprogress/nprogress.css'
// import '@/assets/scss/element.scss'

// Vue.use(Element)

// role="bar" 进度条
// role="spinner" 加载圆
NProgress.configure({
  template: `<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div><div></div>`
})

// loading
Vue.prototype.$loading = NProgress
Vue.prototype.$vditor = Vditor
Vue.prototype.$ajax = axios
Vue.prototype.$echarts = echarts

// 保存整站vuex本地存储的初始状态
window.INIT_CONFIG['storeState'] = cloneDeep(store.state)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
